<template>
  <el-menu
    :default-active="this.path"
    router
    style="height: 100%; min-height: calc(100vh - 40px)"
  >
    <el-menu-item index="/index" >
      首页
    </el-menu-item>
    <el-menu-item v-if="hasPermissions('*.select')" index="/user">
        管理员管理 
    </el-menu-item>
    <el-menu-item index="/building">楼栋管理</el-menu-item
    >
    <el-menu-item index="/dormitory">宿舍管理</el-menu-item
    >
    <el-menu-item v-if="hasPermissions('student.select')" index="/student" >学生管理</el-menu-item
    >
    <el-menu-item index="/info">个人信息</el-menu-item
    >
  </el-menu>
</template>

<script>
import { hasPermission } from "@/utils/auth";
export default {
  name: "AsideView",
  data() {
    return {
      user: {},
      identity: "",
      path: this.$route.path,
    };
  },
  created() {
    
  },
  methods: {
    hasPermissions(permission){
      return hasPermission(permission);
    }
  },
};
</script>

<style scoped>
.icon {
  margin-right: 6px;
}
.el-divider {
  margin: 1px 0; /* 调整分割线的上下间距 */
}
.el-sub-menu .el-menu-item {
  height: 50px;
  line-height: 50px;
  padding: 0 45px;
  min-width: 199px;
}
</style>